hysop.tools.profiler module¶
Tools to collect time profiling information for hysop classes.
- class hysop.tools.profiler.FProfiler(fname)[source]¶
Bases:
object
Class for time measurments on the fly. The objects can be linked to a class method.
Object to profile on the fly sections of code, methods …
Usage:
>>> from hysop.tools.profiler import FProfiler >>> from hysop.core.mpi import Wtime as ftime >>> prof = FProfiler('some_name') >>> start = ftime() >>> # do something ... [1] >>> prof += ftime() - start >>> # do something else ... [2] >>> prof += ftime() - start >>> # ... >>> # print(prof) >>> # --> display total time spent in do [1] and [2] >>> # and number of calls of prof
- class hysop.tools.profiler.Profiler(obj)[source]¶
Bases:
object
Object used to collect profiling information inside operators.
Collect profiling information for all operator method decorate with @profile.
- Parameters:
obj (object (python class) instance. See requirements in notes below.)
Notes
'name' (* obj must have '_get_profiling_info' and)
attribute/method.